package com.ziyougou.test;

import com.ziyougou.OrderBegin;
import com.ziyougou.order.entity.OrderEntity;
import com.ziyougou.order.service.OrderService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.Date;

@SpringBootTest(classes = OrderBegin.class)
@RunWith(SpringRunner.class)
public class Demo1 {
    @Autowired
    private OrderService orderService;

    //新增一条数据到order表
    @Test
    public void test1(){
        OrderEntity orderEntity = new OrderEntity();
        orderEntity.setCreateTime(new Date());
        orderEntity.setOrderSn("test-order");
        orderService.save(orderEntity);
    }
}
